import jqktrader
import pandas as pd
user = jqktrader.use()
if 1:
    user.connect(
      exe_path=r'C:\同花顺软件\同花顺\xiadan.exe',
      tesseract_cmd=r'C:\Program Files\Tesseract-OCR\tesseract'
    )

    info = user.position
    print(info)
    df=pd.DataFrame(info)
    df.to_excel("持仓.xlsx")
    print(user.today_trades)
    result = user.buy("159883", amount=100, price=0.43) # 买入股票
    print(result)
    result = user.sell("123220", amount=10, price=98.320) # 买入股票
    print(result)

    result = user.sell("501222", amount=100, price=0.98) # 买入股票
    print(result)
import pandas as pd
import json
import requests

# df = get_all_etf_data()
# print(df)
# df.to_excel("数据.xlsx")